import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
// import webscoket from '../ceshi/webcoket/index.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/menu/chat'
    },
    {
      path: '/menu',
      name: 'menu',
      component: () => import('@/layout/index.vue'),
      children: [
        // {
        //   path: 'home', // 对应 /menu/home
        //   name: 'Home',
        //   component: () => import('@/views/home/index.vue')
        // },
        {
          path: 'chat', // 对应 /menu/chat
          name: 'chat',
          component: () => import('@/views/talk/HomeView.vue')
        }
      ]
    },
    { path: '/:pathMatch(.*)*', component: () => import('@/views/error/404.vue') }
  ]
})

router.beforeEach((to: any, from: any, next: any) => {
  next()
})
router.afterEach(() => {})

export default router
